import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // 国际化:简体中文

import '@/styles/index.scss' // 全局样式文件

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // 字体图标
import '@/permission' // 权限控制

Vue.use(ElementUI)

Vue.config.productionTip = false
// 封装自定义指令,用来控制操作权
Vue.directive('permission', {
  inserted(el, binding) {
    // el指令作用的元素的dom对象
    const points = store.getters.points
    if (!points.includes(binding.value)) {
      el.remove()
      // el.disabled = true
    }
  }
})
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
